# -*- coding: utf-8 -*- 
# @Time : 2021/10/24 19:44 
# @Author : Dong 
# @File : task_sms.py
from celery import  Celery

from ihome.libs.yuntongxun.send_information import CCP

celery_app = Celery('ihome',broker='redis://127.0.0.1:6379/1')

@celery_app.task
def send_sms(tid,to,datas):
    '''发送短信的异步任务'''

    ccp = CCP()
    ccp.send_template_sms(tid,to,datas)

    return '发送成功'

# worker 启动命令 celery -A ihome.tasks.task_sms worker -l info



